package com.dotflat.physicalevaluate.repository;

import com.dotflat.physicalevaluate.domain.importexport.PhysicEvaluateImportRecord;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

public interface ImportRecordRepository extends JpaRepository<PhysicEvaluateImportRecord, String>, JpaSpecificationExecutor<PhysicEvaluateImportRecord> {

    PhysicEvaluateImportRecord getByCreateTeacherIdAndId(String staffId, String id);

    Page<PhysicEvaluateImportRecord> findAllByCreateTeacherIdAndClassIdAndFinishedIsTrueOrderByCreatedDesc(String staffId, String classId, Pageable pageable);

    PhysicEvaluateImportRecord findTop1ByCreateTeacherIdAndClassIdOrderByCreatedDesc(String staffId, String classId);

}